/*    */ package com.zimbra.cs.service.mail;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.filter.RuleManager;
/*    */ import com.zimbra.soap.JaxbUtil;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.mail.message.ModifyFilterRulesRequest;
/*    */ import com.zimbra.soap.mail.message.ModifyFilterRulesResponse;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class ModifyFilterRules
/*    */   extends MailDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 35 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 36 */     Account account = getRequestedAccount(zsc);
/*    */     
/* 38 */     if (!canModifyOptions(zsc, account)) {
/* 39 */       throw ServiceException.PERM_DENIED("cannot modify options");
/*    */     }
/*    */     
/* 42 */     ModifyFilterRulesRequest req = (ModifyFilterRulesRequest)JaxbUtil.elementToJaxb(request);
/* 43 */     RuleManager.setIncomingXMLRules(account, req.getFilterRules());
/* 44 */     return zsc.jaxbToElement(new ModifyFilterRulesResponse());
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/mail/ModifyFilterRules.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */